﻿@model IEnumerable<MiniBottles.Models.DictCollection>

@{
    ViewBag.Title = "Lista kolekcji miniaturek";
}
@section leftmenu
 {
     @Html.Action("Menu", "Administration")
 }
<p>
    @Html.ActionLink("Dodaj kolekcje", "Create", null, new { @class="btn btn-inverse" })
</p>
<div class="da-panel collapsible">
<div class="da-panel-header">
                                	<span class="da-panel-title">
                                        <img src="images/icons/black/16/list.png" alt="" />
                                        @ViewBag.Title
                                    </span>
                                    
                                </div>
<div class="da-panel-content">
<table id="da-ex-datatable-numberpaging" class="da-table">
                                        <thead>
                                            <tr>
                                                <th>
                                                    @Html.DisplayNameFor(model => model.Name)
                                                </th>
                                                 <th>
                                                   Miniaturka
                                                </th>
                                                <th>
                                                    @Html.DisplayNameFor(model => model.CreateDate)
                                                </th>
                                               
                                                <th>
                                                    @Html.DisplayNameFor(model => model.IsActive)
                                                </th>
                                               <th>
                                                   Akcje
                                               </th>
                                               
                                            </tr>
                                        </thead>
                                        <tbody>
                                           @foreach (var item in Model) {
                                            <tr>
                                                <td>
                                                    @Html.DisplayFor(modelItem => item.Name)
                                                </td>
                                                 <td>
                                                     @if (!string.IsNullOrEmpty(item.FileName))
                                                     {
                                                        <a href="~/Upload/big/@item.FileName" rel="lightbox[roadtrip]" title="@item.Name">
                                                            <img  src="~/Upload/mini/@item.FileName" />
                                                        </a>
                                                     }
                                                </td>
                                                <td>
                                                    @Html.DisplayFor(modelItem => item.CreateDate)
                                                </td>
                                              
                                                <td>
                                                    @Html.DisplayFor(modelItem => item.IsActive)
                                                </td>
                                                <td>

                                                    <a title="Edytuj" href="@Url.Action("Edit",new { id=item.Id })"><i class="icon-pencil"></i></a>
                                                    <a title="Dodaj kategorię do kolekcji" href="@Url.Action("Create","DictCategory", new { collectionId = item.Id })"><i class="icon-plus"></i></a>
                                                   @* <a title="Szczegóły" href="@Url.Action("Details",new { id=item.Id })"><i class="icon-info-sign"></i></a>*@
                                                    @if(item.Categories.Where(x=> !x.IsDeleted).Count() < 1)
                                                    {
                                                     <a title="Usuń" href="@Url.Action("Delete",new { id=item.Id })"><i class="icon-remove-sign"></i></a>
                                                    }
                                                   
 
                                                </td>
                                            </tr>
                                        }
                                        </tbody>
                                    </table>
</div>
</div>